// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import {post} from './utils/http'
import VueI18n from 'vue-i18n'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'font-awesome/css/font-awesome.min.css';

import './mock/mock.js';
// import "babel-polyfill";
// 引入chartJs
import Chart from 'chart.js';
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts

//配置多语言
Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: 'zh',// 语言标识
  messages: {
    'zh': require('./common/lang/zh'),
    'en': require('./common/lang/en')
  }
});

Vue.use(ElementUI);
//配置ajax
Vue.prototype.$post = post

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  components: { App },
  template: '<App/>'
})

//页面的限制，有了相应的权限才允许进入一些页面
// import store from '@/stores/store'   //把这个userId获取过来
// router.beforeEach((to,from,next)=>{
// 	if(to.meta.requireAuth){
// 		if(store.state.userId){
// 			next()
// 		}else{
// 			next({path:'/b'})
// 		}
// 	}else{
// 		next()
// 	}
// })
